Carbon


PBCatSearchAsync

Header: Files.h Carbon status: Supported

Searches a volume’s catalog file using a set of search criteria that you specify. It builds a list of all files or directories that meet your specifications.

OSErr PBCatSearchAsync (
    CSParamPtr paramBlock
);
paramBlock

A pointer to a csParam variant of an HFS parameter block.

function result

A result code.

DISCUSSION

The relevant fields of the parameter block are:

The PBCatSearchAsync function searches the volume you specify for files or directories that match two coordinated sets of selection criteria.

If the catalog file changes between two timed calls to PBCatSearchAsync (that is, when you are using ioSearchTime and ioCatPosition to search a volume in segments and the catalog file changes between searches), PBCatSearchAsync returns a result code of catChangedErr and no matches. Depending on what has changed on the volume, ioCatPosition might be invalid, most likely by a few entries in one direction or another. You can continue the search, but you risk either skipping some entries or reading some twice.

When PBCatSearchAsync has searched the entire volume, it returns eofErr. If it exits because it either spends the maximum time allowed by ioSearchTime or finds the maximum number of matches allowed by ioReqMatchCount, it returns noErr. You can specify a value of 0 in the ioSearchTime field to indicate that no time limit is to be enforced.

Not all volumes support the PBCatSearchAsync function. Before you call PBCatSearchAsync to search a particular volume, you should call the PBHGetVolParmsAsync function to determine whether that volume supports PBCatSearchAsync.

Even though AFP volumes support PBCatSearchAsync, they do not support all of its features that are available on local volumes. These restrictions apply to AFP volumes:

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)